﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<SDT.Model.Menu>>" %>
<div id="menucontainer">
    <ul class="sf-menu">
        <%string cClass = "current";
            var cUrl = Request.Url.PathAndQuery;
          foreach( var m in Model){
              var current = cUrl == m.NavigateUrl ? cClass : string.Empty;
              %>
            <li class="<%=current%>"><a  href="<%=m.NavigateUrl %>"><%=Html.Encode(m.Name) %></a>
                <%var childs = m.ChildMenus.Where(e => e.PubYN == true).ToList();
                  if (childs.Count > 0)
                  { %>
                  <ul>
                    <%foreach (var c in m.ChildMenus)
                      {
                          var childcurrent = cUrl == c.NavigateUrl ? cClass : string.Empty;
                          %>
                      <li class="<%=childcurrent%>"><a  href="<%=c.NavigateUrl %>"><%=Html.Encode(c.Name) %></a></li>
                    <%} %>
                  </ul>
              <%} %>
            </li>
          <%} %>      
          <li><a href="/deal"><img src="/images/mq/i_deal.png" /></a></li>
    </ul>
</div>
<script>
    $(document).ready(function() {
        $("ul.sf-menu").superfish();
    });  
</script>

